home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
sound
/
dmp108.zip
/
DMP.DOC
next >
Wrap
Text File
|
1996-04-06
|
25KB
|
538 lines
Dual Module Player for OS/2 1.08
--------------------------------
This is a port of Otto Chrons' Dual Module Player 4.0 (a DOS program) by
Julien Pierre.
Dual Module Player is a program for playing music modules on different
sound systems on IBM PC compatible machines. It uses DSMI sound
programming interface (Digital Sound & Music Interface) to achieve
high quality sound and wide sound card support.
Currently DMP supports following module formats:
MOD,NST The original Amiga module format (SoundTracker,
NoiseTracker). Also supported by many PC trackers.
Original format supported only 4 channels but many
variants can support up to 32 channels.
STM,S3M Scream Tracker format. S3M can support up to 16
channels while STM is limited to 4.
669 Composer669 module format using 8 channels.
FAR Farandole tracker format capable of using 16 channels.
MTM MultiTracker format. It's a MOD variant with up to 32
channels.
AMF DSMI's internal module format. You can convert all the
previous formats to AMF with M2AMF but not vice versa.
Using AMF format saves you disk space because AMFs are
usually smaller than other module formats. DMP can
also load AMFs faster than other formats. But remember
that you cannot play AMFs on any other player, nor can
you convert AMFs back to any other format.
The command-line syntax is the following :
DMP module [/8] [/16] [/11K] [/22K] [/44K] [/MONO] [/STEREO] [/RANDOM]
[/AMP={NONE,AUTO,LOW,MEDIUM,HIGH}] [/QUALITY] [/NOQUALITY] [/VOL={0-100}]
[/DRIVER={DART,FILE,MMPM2,NOSOUND}] [/FILENAME=name] [/DARTBUFFER=size]
[/LOOP] [/NOPLAY] [/EFF=xx] [/EFFECT=<my_effect_definition>] [/SURROUND]
All the parameters in [] are optional. The order is not relevant.
The only parameter you have to specify is the module filename.
By default, DMP will try to use DART using quality mode, and AUTO
amplification level. It will also try to find the best capabilities for your
soundcard. Priority is in this order : stereo, resolution, then sampling rate.
For example, that means DMP will choose stereo 8-bit 44kHz over mono
16-bit 44kHz, even though they are the same data rate.
If you specify the sampling rate, resolution, or stereo via the command-line,
this autodetection is disabled.
If DMP can't initialize DART, it will automatically try MMPM2 mode.
If you specify a driver via the command line, DMP will only use this one
and not try any other driver.
DMP will report an error if it cannot initialize the soundcard.
You can get an explanation on the parameters by typing DMP without any
parameter.
Here are some additional information :
/8 : switches to 8-bit mode. Default is 16-bit.
Using 8-bit mode degrades the quality. It doesn't decrease the CPU usage -
except if you use the MMPM/2 sound driver.
You should only use this if you have an 8-bit soundcard like an original
Soundblaster or Soundblaster Pro.
/16 : switches to 16-bit mode, which is the default. 16-bit samples give
a better sound quality and should be used if your soundcard is
capable of 16-bit sound.
/MONO : sets monophonic mode. Default is stereophonic.
Using this option will divide the CPU time required by two.
/STEREO : sets stereophonic mode, which is the default.
/NOQUALITY : disables quality mode. Default is quality mode.
Quality mode was originally implemented only on 8-bit sounds cards to
overcome the dynamic limitation of 8-bits. It uses 16-bit mixing
routines to achieve 96dB dynamic range (instead of 48dB) and post
processes the 16-bit data into 8-bits with a look-up table that
amplifies the sound. Because of this post processing, the Quality mode
takes more processor power but it's worth it. To further amplify the
sound you can use '/AMP=level' command line option.
The sound drivers only support quality mode when mixing at 8 bit.
Initialization will fail if you try /8 in conjunction with /NOQUALITY.
For 16-bit cards there's no need to use Quality mode to improve the
quality of the sound. But with up to 32 channels the dynamics of
individual channels go worse i.e. the volume is lower. You can of
course select an amplification option in the sound setup to amplify the
sound but there is always a risk of click and noise if the sound
overruns. This is where 16-bit Quality mode comes in. It uses a
temporary 32-bit buffer to do the mixing and post processes the buffer
by clipping values that can't fit to 16-bits.
/QUALITY : enables quality mode, which is the default.
/DRIVER=name : sets the sound driver. May be DART (default), MMPM/2, or FILE.
/DRIVER=MMPM2 :
If DMP cannot initialize DARt, it will use the MMPM/2 sound driver which
should work on all soundcards supported by MMPM/2. However, this requires a
lot of memory for buffering, and also a lot of CPU. Because of buffering, the
response to keyboard commands will be delayed - from 4 seconds in 16-bit 44
kHz stereo mode to about one minute if you use 8-bit 11 kHz mono mode (I
strongly discourage you from using this one !). Also, there will be a
corresponding delay before the sound begins. So be patient when using
low-quality modes ! Don't e-mail me to say you don't hear anything.
The initial delay is due to a bug in MMPM/2 that I bypassed by putting 800
KB of blank data at the beginning. If IBM solves this one, I could remove it.
However, the delay in response cannot be suppressed when using MMPM/2
playlists. The delay doesn't apply to the volume command, which controls the
hardware setting of the soundcard.
/DRIVER=DART :
To overcome these limitations, IBM created DART - Direct Audio real-time.
It allows much faster access to the soundcard, and real-time as the name says.
It has none of the drawbacks of MMPM/2 playlists mentioned above.
There will be no initial delay and the keyboard response should be instant.
The problem with DART is that it hasn't been officially released. To use it,
you need two DLLs from the Entertainment Toolkit that is found on
Developer's Connection Volume 8 - new versions of AMPMXMCD.DLL and AUDIOSH.DLL.
I was told they could be found at
http://www.polsci.wvu.edu/Henry/Files/dart.zip
Download at your own risk.
Another problem is that it doesn't work well with all soundcards (see the
/DARTBUFFER parameter), and some cards will require new drivers.
IBM still hasn't answered me about the distribution of the DART DLLs - I
don't know if I am allowed to distribute them with my application. In doubt,
I didn't put them. So sadly you'll have to get a Devcon 8 to use DMP in DART
mode.
/DRIVER=FILE :
This sound driver directs output to the hard disk, just as in the first alpha
of DMP that was released in August. By default it goes to TEST.WAV, but you
can change this with /FILENAME=name.
The volume command has no effect in this mode.
/DRIVER=NOSOUND :
This is a fake sound driver. There is no output when using that driver. It's
mostly there for testing. You can also use it with /NOPLAY to test if your
modules are loadable with DMP.
/NOPLAY :
Prevents DMP from playing the file. In this mode, DMP will just load the files
given at the command line without playing them or prompting for keyboard.
It's useful to test if your modules are compatible with DMP. If you don't want
DMP to take the sound card, use /DRIVER=NOSOUND.
/DARTBUFFER=size :
This parameter sets the size of the DART buffer.
By default, DMP will use the value suggested by the soundcard driver.
If you have problems with the sound (distortion, or sound stops under heavy
system load), you can override it. Be careful with that parameter.
The current beta of DART (from Devcon 8/9) can crash OS/2 entirely when using
incorrect parameters. It does this if I use a small buffer (<512 bytes) or
large (>64K). Beware that the higher the buffersize, the less real-time DMP
will be.
If you can't get it to work right, try running DMP in MMPM/2 mode instead.
New soundcard drivers may also solve the problem.
/LOOP :
This mode will make the module loop forever. You'll have to type ESC to stop it.
:songlist : plays a list of files.
This option will make DMP play each module listed in the "songlist" file.
It must be an ASCII file containing the full name of each module with relative
paths. You can include wildcards inside songlists.
/RANDOM : will play the modules in random order.
/VOL=xxx : sets the volume to xxx at the beginning of the program, with
0<=xxx<=100.
/MOD : when this switch is on, DMP will assume that a file is a 15-channel
MOD when it doesn't recognize its format. By default it will report an error.
This is needed because these modules do not have a signature.
Beware : if you try to load non-MOD files, it might crash the program.
/EFF=xx : selects predefined effect number xx. See the list of effects in the
effects section later in this file.
/EFFECT=<my_effect_definition> : creates and selects your own effect. See the
documentation on "Creating your own effects" later in this file.
/SURROUND : enable Surround sound for all channels. Be aware that a module can
change the panning on any channel and thus reset it while playing. You can
reset all channels to Surround during playing with the S key. You can also
disable surround with the R key.
I think that's it.
Surround Sound
--------------
Surround sound is implemented! Pressing the 'S' key sets the module into
surround. If you have a Dolby Pro Logic Surround Sound Decoder you can hear
the sound coming from your surround speaker, but even without this decoder you
get a more "spacier" effect (similar effect found on many stereo TVs to enhance
mono sound). Use command line option /SURROUND to set all tracks to surround mode.
Digital effects
---------------
New to DMP 1.07 is the support for digital effects. Currently you can do
reverb/echo style of effects and simple lowpass filtering.
There are 10 predefined effects and you can select between them with command
line parameter '/EFF=x' (where x=0 to 9).
Filters
-------
You can use two different lowpass filters to filter the noise caused by
aliasing in mixing routines. These filters are really simple so they
don't use much processor power.
Filter 1 algorithm is defined as:
y(n) = 0.5*x(n) + 0.5*x(n-1)
Filter 2 is:
y(n) = 0.75*x(n) + 0.25*x(n-1)
Of course the actual filter routines use simple additions and shifts instead
of floating point multiplications to achieve best possible speed.
By default DMP uses the Filter 2 (this can be changed with '/EFF=x' command
line parameter).
Reverb/echo effects
-------------------
DMP uses a user definable reverb/echo engine to create effects from massive
reverbs to funny sounding echos. Here is the diagram of that engine.
┌─────┐ ┌────────┐
│Input├─────────────────────────────────┬──┤ │ ┌──────┐
└─────┘ ┌────────┐ │ │ Filter ├──────────┤Output│
┌──────────────────────┤ ├────│──┤ │ └──────┘
│ ┌─────────────┤ Filter │ │ └────────┘
│ │ ┌───────┤ ├─┐ │
│ │ │ └────────┘ │ │
│ │ │ │ │
│ │ │ │ │
│ │ │ │ │
│ │ │ -----│
│ │ │ feedback\ G /│ G = gain
"echos"│ │ │ \_/ │
/ \ / \ / \ │ │ D = delay
/ G1\ / G2\ / G3\ │ │
----- ----- ----- │ │
│ │ │ ┌┴──┴┐
│ │ │ │ ++ │
│ │ │ └──┬─┘
│ │ │ │
│ │ │ │
D1 │ D2 │ D3 │ │
┌───┴────────┴─────┴───────────────┐ │
┌─┤ delay line │ │
│ └──────────────────────────────────┘ │
│ │
│ │
└─────────────────────────────────────────┘
The number of echos can be from one to eight and each has its own position on
the delay line and its own gain value. You can change the number of echos and
parameters for each echo on the command-line using /EFFECT=<your echo>.
You can also set the "feedback" value.
You can also use negative gain values to create a 180 degree phase shift.
The filters used in reverb are the same as in filter 1.
Setting a reverb on the command line looks like following:
/EFFECT=<effect_name> R <feedback> <echo 1 delay> <echo 1 gain>
Use a tilde ("~") character as space character.
See "Creating your own effects" for examples on reverbs and echos.
Reverb performance
------------------
Calculating one echo in reverb engine requires a few simple arithmetic
instructions and one multiplication. In addition calculating feedback
requires another multiplication. So with a 6 echo reverb the routine
must do seven multiplications and lots of simple instructions for EACH
AND EVERY SAMPLE from input. In comparison the mixing routines in the
actual sample playback engine require only a few simple instructions
per sample.
Unless you have a powerful 486 it's not wise to use stereo mode
because this doubles the reverb overhead. Even on a 486/33 using
reverb with 44kHz stereo data can bring the machine on its knees. On
slower machines you will start to hear pauses in the playback
as DMP can't keep up with sound card DMA.
Using simple echos requires a lot less processor computing power, it's
all dependant on the number of echos.
Creating your own effects
-------------------------
You can define your own effect by using the /EFFECT="my effect definition" parameter.
Here is the description of an effect :
"name type parm0 [parm1] [parm2] ..."
Use a tilde "~" character for spacing.
<name> is a one word name for the effect and cannot contain white space
You can use '_' instead of space character to break it into multiple words
<type> can be:
R Reverb/echo effect.
parm0 is feedback value (0-100).
parm1...parmN define a maximum of 8 reverb delay/gain pairs
for example:
Effect1 = HallReverb R 40 30 50 40 30 50 20 60 30
defines Reverb with 40% feedback and echo positions at
30ms (50% gain), 40ms (30% gain), 50ms (20% gain), 60ms (30% gain)
Negative gain values can be used to create 180 degree phase shift
F Filter effect. parm0 is the type of the filter:
1 = Simple lowpass filter (effective)
2 = Simple lowpass filter (soft)
Here are the definitions for the 10 DMP predefined effects :
Effect 0 : No_Effect
Effect 1 : Lowpass_filter~F~1
Effect 2 : Soft_lowpass_filter~F~2
Effect 3 : Hall_reverb~R~30~100~-15~120~30~140~-35~175~30~200~20
Effect 4 : Room_reverb~R~35~5~20~20~-30~30~-20~40~40
Effect 5 : Hall_reverb_big~R~86~42~16~79~-19~107~24~157~-27~163~28
Effect 6 : Metallic_reverb~R~60~30~30~40~-25~50~25~80~25
Effect 7 : Air_Duct_Reverb~R~60~20~18~40~-48~50~-58~90~13
Effect 8 : Distant_echo~R~75~160~30~300~50
Effect 9 : Bass_boost~R~0~0~60
Effect 10 : Heavy_bass_boost~R~-10~0~150
GREETINGS
---------
I have to thank many people for their testing of DMP. If you have been
forgotten, I'm sorry. I'll put you in the next version ;)
Oc, Culus, Nightboob, Os2wizard, dandaman, rwg, hrbeing, Timur Tabi, alav,
Linden deCarmo.
I must say the OS/2 porting was a real nightmare. It lasted 17 months,
but it made me about 10 years older even though I'm only 19.
CONTACTING THE AUTHOR
---------------------
I can be contacted on the internet as madbrain@netsrq.com.
I recently moved from France to Florida. My new mailing address is :
Julien Pierre
1664, Cherry Lane
Appartment 3
Sarasota, Florida 34236
USA
You can also find me as "madbrain" on Internet Relay Chat (check my name
as several people are using that nickname unfortunately).
You can usually find the latest release version of DMP on hobbes.nmsu.edu.
Betas will be available from my homepage at
http://www.polsci.wvu.edu/Henry/Madbrain
Note : the server went down as of March 18th, but it should be back about a
week later.
BUGS
----
No program is 100% bug free and DMP is no exception, but I have been fighting
with bugs very hard before releasing it - that's why it took so much time.
If you ever used the alphas of DMP that I posted on Hobbes, you can see the
huge improvement. I have been congratulated about its stability indeed.
When reporting a bug, please always mention which soundcard you are using,
with the version of the driver, the version of MMPM/2 and OS/2.
Known bugs :
- Users have reported various problems when using some soundcards :
* PAS/16. Here is my advice for this card : use the DART DLLs and the
/DARTBUFFER=16384 parameter. MMPM2 mode may or may not work correctly.
* SB Pro. Volume control is reportedly screwed. But CL isn't developing
the SB Pro drivers anymore.
* SB AWE 32
* GUS. I'm told you should use ULTRA085 for DMP to work with it.
Others have had great success with those, so I don't really know what to
do. It seems to depend a lot on the driver. Actually I have regular SB16s in
both of my machines so I can't test them all myself.
I'm going to fix DMP for the PAS/16 at least as my mother has one in her PC.
I wish the SB Pro driver would load with a SB16, but there is a hardware
check and it doesn't. For SB AWE and GUS, you're on your own - unless you
want to offer me one. You have my address afte all !
- In MMPM/2 mode, the module stops before it is finished. That's because of
MMPM/2 buffering. It will eventually be corrected, but I recommend using
DART wherever possible.
- a few modules will still crash DMP. But they also crash DMP for DOS :-)
* New SB "DART" drivers.
I have been in contact with the driver author at Creative. He says it
they work fine as long as you set the DARTBUFFER at half the size of
the DMA buffer set in CONFIG.SYS on the command-line of your driver.
Doesn't sound very practical to me ! It looks like the previous (Warp)
SB drivers were more DART-compliant !
REVISION HISTORY
----------------
1.0, released November 30th, 1995 : initial release.
1.01, released December 5th 1995 : bugfix in the initialization routine,
addition of songlist mode.
1.02, released December 11th 1995 :
- addition of wildcard support (including inside songlists)
- "@" character for songlists was replaced by ":" since "@" can be used in
filenames
- addition of "/VOL=" option to set volume on startup
- you can now use any number of songlists and files on the command line
- addition of the "Q" key to exit the program instead of going to the next
module
- addition of random playing mode with /RANDOM
1.03, released December 19th 1995 :
- correction of a small bug in file parsing introduced in 1.02.
Apparently I was the only one to discover it.
- separation of the DSMI interface and the sound drivers.
DSMI is now compiled with Watcom instead. As a result :
* some corrupted modules which previously caused DMP to crash
will now load. This is because of differences between the IBM &
Watcom runtime libraries.
* no more bug in looping mode. I still have to figure out why,
though :-)
- the sound drivers remain compiled with IBM C Set ++ because I
can't get the Warp Toolkit to work with Watcom correctly, and
some of my C++ doesn't work with it also.
- small modification in DART volume command. *might* correct a
problem with DART & SB Pro. I need feedback on this.
- DSMI for OS/2 should now be at the exact same level of
stability as the DOS version.
- Phone bill to pay now $3000 :-(
1.04, released February 10th 1996 :
- added the /MOD parameter to assume 15-channel MOD file.
- removed some debug code in the DART sound driver that caused beeps to
be generated on the PC speaker.
- added support for /16, /STEREO and /QUALITY parameters to make the
command-line more consistent.
- corrected a bug in memory deallocation that caused a crash.
- added support for the NOSOUND driver via /DRIVER=NOSOUND.
- added the /NOPLAY parameter.
- made DETECT mode the default and removed the /DETECT parameter.
- added information about the sound driver loaded by DMP and its settings.
- corrected a bug in the FILE driver which appeared when overriding the output
file name.
- modified the DART driver to use the suggested buffer value instead of 4096.
- corrected a bug in the S3M loader which sometimes caused an exception at
the end of a module.
- compiled with C Set ++ 2.1 again
1.05, released March 9th 1996 :
- fixed a stupid bug in command-line parsing that was optimized in 1.04. It
prevented some parameters from being accepted, like /VOL=xx where xx had more
than one digit.
- added the M2AMF utility to convert modules to the AMF format, which takes less
space. Keep in mind you can only play those with DMP, and the conversion only
works one way.
- played with compiler optimizations a bit to reduce EXE/DLL size. I hope it
still works :-)
- modified the sound drivers to return an error when noquality 8-bit mode
was request. Trying this on previous versions produced an exception.
1.06, released March 20th 1996 :
- ExtTempo could cause a crash with incorrect values. Fix 3/14
- MOD loader could cause a hang (with DMP unkillable) in the samples
loading function. Fixed 3/14
- some other MOD loader fixes
- corrupted modules better supported
1.07, released March 23rd 1996 :
- added Filter and Reverb effects using the /EFF= and /EFFECT= parameters
1.08, released April 6th 1996 :
- added Dolby Surround sound option with /SURROUND or S key while playing
- really made Soft Lowpass Filter the default. No filter was used by default
in 1.07 despite what the doc said
- now shows which effect is used upon startup
- allows you to change effects while playing with the P/N keys
- switched from C to C++. DMP now uses some features of the IBM Collection
Class Library for memory management. That is why the EXE gained 40K in this
version. The performance is still as good as ever, though.
- DMP will now detect MMPM/2 automatically correctly when DART is not
present on the system. This was a bug in previous versions of DSMI.
- DMP will now display the title of a song when it is loaded
UPCOMING FEATURES
-----------------
I may or may not do the following :
- add the .XM module format
- write a MMPM/2 IO Procedure for modules so that they are supported
automatically in all MMPM/2 applications.
- port the textmode interface of DOS DMP to OS/2
- rewrite the MMPM/2 driver so that the buffering problem is gone
- change the driver model to an extensible object-oriented architecture,
so that someone can write a driver for native GUS for example.
- add support for the older SBOS2.SYS driver. This would make DMP work
on SB clone cards that don't have an OS/2 driver.
- modify the multimedia drivers so that system sounds can interupt the
module playing.
- integrate DSMI with the IBM Real-Time MIDI subsystem to make audio/music
synchronization possible.
I'm currently developing :
- a PM graphical user interface for DMP
You can find the latest beta on my homepage in the /software directory.
LICENSE
-------
Dual Module Player for OS/2 is a freeware program.
Dual Module Player is copyrighted by me and Otto Chrons.
You are only allowed to distribute it in its original form.
Programmers interested in using modules in their OS/2 programs should look at
the DSMI.OS2 file. DSMI is a commercial library, not freeware.